]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
environment: Apply autoReverse/repeatCount to all transitions
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 21 Oct 2021 17:50:18 +0000 (19:50 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 21 Oct 2021 17:52:33 +0000 (19:52 +0200)
Like the old Tweener API, ease() allows to transition multiple
properties at once. If autoReverse or repeatCount are specified,
they should apply to all transitions, but right now we only set
them for the first one.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2007>

js/ui/environment.js

index ccd7dcdaa6e3f0dc86204069e339777e81f64030..ef53e602248cc6ee5794fc6dd0179130b908e4d6 100644 (file)
@@ -201,20 +201,23 @@ function _easeActor(actor, params) {
         actor.set(params);
     actor.restore_easing_state();
 
-    let transition = animatedProps.map(p => actor.get_transition(p))
-        .find(t => t !== null);
+    const transitions = animatedProps
+        .map(p => actor.get_transition(p))
+        .filter(t => t !== null);
+
+    transitions.forEach(t => t.set({ repeatCount, autoReverse }));
+
+    const [transition] = transitions;
 
     if (transition && transition.delay)
         transition.connect('started', () => prepare());
     else
         prepare();
 
-    if (transition) {
-        transition.set({ repeatCount, autoReverse });
+    if (transition)
         transition.connect('stopped', (t, finished) => callback(finished));
-    } else {
+    else
         callback(true);
-    }
 }
 
 function _easeActorProperty(actor, propName, target, params) {